import React, { useContext } from 'react'
import PropTypes from 'prop-types';
import { Button } from 'antd';
import ThemeContext from './ThemeContext';

export default function VoteFooter() {
    const store = useContext(ThemeContext)
    // let { change } = props
    return (
        <div className="footer">
            <Button type="primary" onClick={()=>{
                store.dispatch({
                    type:'VOTE_SUP',
                    payload:10
                })
            }}>支持</Button>
            <Button onClick={()=>{
                store.dispatch({
                    type:'VOTE_OPP',
                })
            }}>反对</Button>
        </div>
    )
}

// 初始化属性 & 规则校验
VoteFooter.propTypes = {
    change: PropTypes.func.isRequired
};
